package eunji;

import java.util.Scanner;


public class SMSystem {
 
 /*Member 클래스에서 쓰는 필드를 가져옴*/
 private Member member;
 /*Salary 클래스에서 쓰는 필드를 가져옴*/
 private Salary salary;
 
 /*Member 및 Salary 클래스를 사용하기 위해 객체를 만들어주는 constructor*/
 SMSystem(){
  
  member = new Member();
  salary = new Salary();
  
  }
 
 /*constructor를 이용한 초기화*/
// public SMSystem(int number){
//  
//  this.name= new Member(name);
//  this.age = new Member(age);
//  this.number = new Member(number);
//  this.level = new Memver(level);
//  
//  this.pay = new Salary(pay);
//  this.levelpay = new Salary(levelpay);
//  
// }
 
 
 public void setMatching(String level){
  
  String le;
  le=level;
  
  
  if(le=="사원"){
   salary.setLevelPay(0);
   }else if(le=="대리"){
    salary.setLevelPay(100);
   }else if(le=="과장"){
    salary.setLevelPay(100);
   }else if(le=="차장"){
    salary.setLevelPay(200);
   }else if(le=="부장"){
    salary.setLevelPay(200);
   }else if(le=="사장"){
    salary.setLevelPay(300);;
   }else{
    System.out.println("잘못입력하셨습니다.");
   }
  
  }
 
 public float getMatching(){
  return salary.getLevelPay();
 }
 
 
 public static void main(String[] args){
  
  Scanner sc= new Scanner(System.in);
  SMSystem sms = new SMSystem();
  Member mb = new Member();
  Salary sa = new Salary();
  String quit;
  
  //틀린그림찾기
  System.out.println("프로그램 사용이 처음입니다. 사원정보를 입력해주세요!");
  do{
  System.out.println("사원번호를 적어주세요!!");
  mb.setNumber(sc.nextInt());
  System.out.println("사원이름을 적어주세요!");
  mb.setName(sc.next());
  System.out.println("나이를 적어주세요!");
  mb.setAge(sc.nextInt());
  System.out.println("직급을 적어주세요!");
  mb.setLevel(sc.next());
  
  
  sms.setMatching(mb.getLevel());
  sa.setTax(sms.getMatching());
  sa.setRealsalary(sa.getPay(), sa.getRealsalary(), sa.getTax());
  sa.setSalary(sa.getPay(), sa.getLevelPay());
  sa.setRisesalary(sa.getSalary());
  
  
  System.out.println("사원정보를 더 입력하시겠습니까? Y/N");
  
  quit=sc.next();
  
  } while(quit=="Y" || quit=="y");
  System.out.println("사원번호"+"\t"+"이름"+"\t"+"나이"+"\t"+"직급"
  +"\t"+"기본급여"+"\t"+"직급별급여"+"\t"+"세금"+"\t"+"실수령액"+"\t"+"현재연봉");
  System.out.println(mb.getNumber()+"\t"+mb.getName()+"\t"+mb.getAge()
    +"\t"+mb.getLevel()+"\t"+sa.getPay()+"\t"+sms.getMatching()
    +"\t"+sa.getTax()+"\t"+sa.getRealsalary()+"\t"+sa.getSalary()+"/t"+sa.getRisesalary());
   
  
 }
 
}
//public void setName(String name){
// this.name.setName(name);
//}
//
//public void setKor(int kor){
// this.kor.setScore(kor);
//}
//public ScoreMag(String name, int kor, int eng, int mat){
// 
// this.name = new Name(name);
// this.kor = new Subject(kor);
// this.eng = new Subject(eng);
// this.mat = new Subject(mat);
// 
//}
//public ScoreMag()
//{
// name=new Name();
// kor = new Subject();
// eng = new Subject();
// mat = new Subject();
//}
//float tax, realsalary, risesalary; //tax:세금, realsalary:실수령금, risesalary:내년오를연봉
//
//int pay,levelPay,salary; //pay:기본급여, levelPay:직급별 추가 급여, salary:연봉
//String name;
//int age;
//String number;
//int level;
 
//public class ScoreMag{
// 
// private Name name;
// private Subject kor;
// private Subject eng;
// private Subject mat;
// int total;
// float avg;